﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Chefbook.UserActions;
using NUnit.Framework;
//using Chefbook.DataObjects;
using Chefbook.DataAccessLayer;

namespace UnitTests.UserActionsTests
{
    public static class UserActionTestsHelper
    {
        public static void UndoActionThatIsNotUndoableTest(IUserAction action)
        {
            action.DoAction();
            Assert.That(action.IsUndoable == false);
            Assert.Throws<InvalidOperationException>(action.UndoAction);
        }

        public static void UndoActionWithoutDoingTest(IUserAction action)
        {
            Assert.Throws<InvalidOperationException>(action.UndoAction);
        }

        public static void UndoActionTwiceAfterDoingTest(IUserAction action)
        {
            action.DoAction();
            action.UndoAction();
            Assert.Throws<InvalidOperationException>(action.UndoAction);
        }

        public static void DoActionTwiceTest(IUserAction action)
        {
            action.DoAction();
            Assert.Throws<InvalidOperationException>(action.DoAction);
        }
    }
}
